import 'package:flutter/material.dart';

//一般页面导航和返回

/**
 * 第一个简单导航页面
 */
class FirstSimpleNavigatorWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("FirstSimpleNavigatorWidget"),
      ),
      body: Center(
          child: RaisedButton(
        onPressed: () {
          Navigator.push(
              context,
              MaterialPageRoute(
                  builder: (context) => SecondSimpleNavigatorWidget()));
        },
        child: Text("查看详情"),
      )),
    );
  }
}

/**
 * 第二个简单导航页面
 */
class SecondSimpleNavigatorWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("SecondSimpleNavigatorWidget"),
      ),
      body: Center(
          child: RaisedButton(
        onPressed: () {
          Navigator.pop(context);
        },
        child: Text("返回"),
      )),
    );
  }
}
